#ifndef __ACCOUNT_H_
#define __ACCOUNT_H_

#include <pthread.h>

typedef struct
{
    int code;
    double balance;
    pthread_mutex_t mutex;
} Account;

// 创建账户
extern Account *create_account(int code, double balance);

// 销毁账户
extern void destroy_account(Account *a);

// 取款
extern double withdraw(Account *a, double balance);

// 存款
extern double deposit(Account *a, double amt);

// 查询账户余额
extern double get_balance(Account *a, double amt);

#endif /* __ACCOUNT_H_ */